home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: twisto.eng.hou.compaq.com!news
- From: Saurabh Dixit <saurabhd@bangate.compaq.com>
- Subject: Re: Is this code valid?
- Message-ID: <30F43E85.7C9B@bangate.compaq.com>
- Sender: news@twisto.eng.hou.compaq.com (System Administrator)
- Mime-Version: 1.0
- X-Mailer: Mozilla 2.0b2 (Windows; I; 32bit)
- Content-Type: text/plain; charset=us-ascii
- Organization: Compaq Computer Corporation
- Date: Wed, 10 Jan 1996 22:32:37 GMT
- References: <30F3E42D.74BA@sto.fdata.se>
- X-Nntp-Posting-Host: 172.18.176.8
- Content-Transfer-Encoding: 7bit
-
- Niklas Mellin wrote:
- >
- > class X
- > {
- > public:
- > class Y;
- > };
- >
- > class X::Y
- > {
- > };
- >
- > int main(int, char* [])
- > {
- > throw X::Y();
- > return 0;
- > }
- >
- > It doesn't matter if the throw statement is in main or in
- some
- > other function, and it makes no difference if there is a
- catch
- > statement.
- >
- > When linking the code above in Borland C++ 4.0 the ide
- crashes
- > killing windows too (it took me a while to isolate the
- problem).
- >
- > Borland 4.5 doesn't crash but reports: "Internal error..."
- some
- > number.
- >
- > My question: Is it allowed to throw objects of nested
- classes?
- >
- > ---
- > Niklas Mellin
-
- Though I wouldn't expect a compiler to crash when it
- encounters possible bad code, I don't see what you are
- trying to throw.
- Don't you need an object to throw?
- In the statement
- throw X::Y() where is the object?
-
- --
- Saurabh Dixit
- "All opinions are always my own..."
- Compaq Computer Corporation
- --------------------------------------------------------------
- ----------
- Thou who sneezes without kerchief takes matters in own hands.
- - SomeoneIOnceNew
- --------------------------------------------------------------
- ----------
- xxxx
-